The debugger command line

Commands include the jdb commands, enhanced by a subset of the gdb commands.
The quickest way to get an overview of the debugger command line commands is to

- type

help at the prompt (sniffjdb) in the Debugger Command Line Shell.
All available commands are then listed in alphabetical order together with syntax and a short description.
Functionality differences between sniffjdb and jdb
Added functionality

vt - starts the graphical Threads Viewer.
print [*] <id> | this - the print commands open the graphical Variable Viewer and show the values of specified (member) fields. Information is not updated automatically at each breakpoint. To update, choose the Variable Viewer's View > Update.
display, undisplay - these accept the same syntax as the print commands. The difference is that the information is automatically updated in the graphical Variable Viewer every time a breakpoint is reached.
step out - executes next until a breakpoint in another method is reached. Does not trace execution.
finish - executes next until a breakpoint in another method is reached. Traces execution.
show - prints SniffJdb version number
about - opens an About dialog
- extended
break/clear syntax (see below)
Removed functionality

use , list - these commands only make sense for a pure command line debugger.
Command Reference
Display

Command | Description
print *<id> | Print information about object pointed to.
locals | Print values of parameter and local variables of the current stack frame
memory | Report memory usage.
print <id> | Print value of specified variable.
print this | Print local variables

Automatic display

Command | Description
display | Lists all display expressions.
display <id> | Display value of the specified object.
display *<id> | Display the object pointed to.
undisplay [*]<id> | Stop displaying the specified object.

Breakpoints

Command | Description
break [at] <class id>:<line> stop [at] class id:line | Break and stop can be used as synonyms.
break [at] <file name>:<line> stop [at] <file name>:<line> | Set a breakpoint in the specified file at the specified line. This command works only if the public class of that file is already loaded (see load command).
break [in] <class id>:<method name> stop [in] <class id>:<method name> | Set a breakpoint at the specified line in the file where the specified class is defined.
clear [at] <class id>:<line> | Remove a breakpoint at the specified line in the specified file.
clear [at] <file name>:<line> | Remove a breakpoint at the specified line in the file where the specified class is defined.
clear [in] <class id>:<method name> | Remove a breakpoint at the first line of the specified method.

Execution Control

Command | Description
cont | Continue execution from breakpoint.
exit | Terminate execution.
finish | Execute next until a breakpoint in another method is reached. Do not trace execution.
next | Execute the next statement, step over methods.
run [<class>] [args] | Start execution of a loaded Java class.
step | Execute next statement, step into methods.
step out | Execute next until a breakpoint in another method is reached. Trace execution.
!! | Repeat last command

Exceptions

Command | Description
catch <exception class name> | Break when the specified exception is thrown.
ignore <exception class name> | Do not break when the specified exception is thrown.

Other

Command | Description
gc | Trigger garbage collection.
help | List commands. For space reasons this listing does not contain all possible ways to express the same.
itrace [ | on | off ] | Toggle method trace mode. Does not currently work with sun.tools.debug .
load <class name> | Load Java class.
trace [ | on | off ] | Toggle instruction trace mode. Does not currently work with sun.tools.debug .
reload | Reload the debugged class. Makes sense after recompilation of source. Keeps breakpoints.
show [version] | Print version information.

Stack

Command | Description
bt [ thread id | all ] backtrace [ thread id | all ] | Dump thread stack
where [ thread id | all ] | Dump thread stack.
down [n frames] | Move down thread stack.
frame <number> | Move to the specified frame of thread stack.
up [n frames] | Move up thread stack.

Remote Debugging

Command | Description
connect <hostname> <password> | Connect debugger to a remote process. You get the password on starting the application with the debug option.

Symbolic information

Command | Description
classes | List currently known classes.
methods <class id> | List a class's methods.

Threads

Command | Description
vt | Start Threads Viewer
viewthreads | Start Threads Viewer
kill <thread(group)> | Kill a thread or threadgroup.
resume [thread id(s)] | Resume threads (default: all).
suspend [thread id(s)] | Suspend threads (default: all).
thread <thread id> | Set default thread.
threadgroups | Suspend threads (default: all).
threadgroup <name> | Set current threadgroup.
threadgs | List threads.